<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="viewport"
			content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover" />
		<title>K线指标</title>
		<style type="text/css">
			body {
				margin: 0;
			}
		</style>
		<!-- <link rel="stylesheet" type="text/css" href="css/kline.css"/> -->
	</head>

	<body>
		<div id="app" class="page">
			<div id="tv_chart_container"></div>
		</div>
		<script type="text/javascript" src="js/charting_library-master/charting_library/charting_library.standalone.js">
		</script>
		<script type="text/javascript" src="js/charting_library-master/datafeeds/udf/dist/polyfills.js"></script>
		<script type="text/javascript" src="js/charting_library-master/datafeeds/udf/dist/bundle.js"></script>
		<!--  -->
		<script type="text/javascript" src="js/uni.webview.1.5.2.js"></script>
		<script type="text/javascript" src="js/echarts.min.js"></script>
		<script type="text/javascript" src="js/qs.js"></script>
		<script type="text/javascript" src="js/axios.js"></script>
		<script type="text/javascript" src="js/md5.min.js"></script>
		<script type="text/javascript" src="js/vue.js"></script>
	</body>
</html>
<script type="text/javascript">
	function getParameterByName(name) {
		name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
		var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
			results = regex.exec(location.search);
		return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
	}

	function initOnReady() {
		var mlocale = getParameterByName('locale')
		if(!mlocale){
			mlocale = 'zh'
		}
		var widget = window.tvWidget = new TradingView.widget({
			// debug: true, /*开日志*/
			fullscreen: true,
			/*显示图表是否占用窗口中所有可用的空间*/
			symbol: 'BTCUSDT',
			// symbol: 'AA',
			/*初始商品*/
			interval: '1D',
			/*周期***D(天)W(周)M(月)****/
			container: "tv_chart_container",
			/*DOM 元素*/
			// datafeed: new Datafeeds.UDFCompatibleDatafeed("https://demo-feed-data.tradingview.com"),/*实现（JS API）接口以向图表提供数据*/
			datafeed: new Datafeeds.UDFCompatibleDatafeed("http://api.ea-togo.com/"),
			// datafeed: new Datafeeds.UDFCompatibleDatafeed("http://192.168.3.17:9095/"),
			/*实现（JS API）接口以向图表提供数据*/
			library_path: "js/charting_library-master/charting_library/",
			/*static文件夹的路径*/
			locale: mlocale,
			/*语言*/
			disabled_features: ["use_localstorage_for_settings",
				"header_wi	dget",
				"widget_logo",/*logo*/
				// "left_toolbar"/*左侧工具栏*/
			],
			/*禁用名称的数组*/
			// enabled_features: ["study_templates"],
			/*启用名称的数组*/
			client_id: 'tradingview.com',
			user_id: 'public_user_id',
			charts_storage_api_version: "1.1",
			/*后台版本。支持的值:"1.0"|"1.1"*/
			theme: getParameterByName('theme'),
			/*为图表添加自定义主题颜色。 支持的值是: "Light" | "Dark"*/
			time_frames: [{
				text: "50y"
			}],
			timezone: "Asia/Hong_Kong",
		});

		widget.onChartReady(function() {
			widget.onGrayedObjectClicked(function(data) {
				// 当您尝试创建能量均衡指标或趋势形状时
				// 此方法将被调用
				
				alert(data.name + " is grayed out!");
			})
		});
	};

	window.addEventListener('DOMContentLoaded', initOnReady, false);
</script>
